package com.py.net.client.input;

import com.google.protobuf.MessageLite;
//import com.py.net.proto.ChatProbuf.CTSLogin;
import com.py.chat.UI.UI;
import com.py.chat.proto.ChatProbuf.CTSLogin;

public class CTSLoginBuilder implements IInputBuilder {
	@Override
	public MessageLite builder(String lineStr) {
		
		//返回主菜单
		if(lineStr.equals("Q")){
			UI.mainUI();
			return null;
		}
		String[] param = lineStr.split("&");
		if (param.length < 2) {
			UI.msgUI("登陆请求输入有误");
			return null;
		}
		return CTSLogin.newBuilder().setName(param[0]).setPwd(param[1]).build();
	}
	
	@Override
	public void showUI() {
		// TODO Auto-generated method stub
		UI.loginUI();
	}


}
